// pages/component/people/choosecourse.js
const app = getApp();
var CONFIG = require("../../../config/config.js");
var share = require('../../../utils/share.js');
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        infordatauid: {
            type: Object,
            value: '',
        },
        teamtypeall: {
            type: Number,
            value: '',
        },
        newconidall:{
            type: Number,
            value: '',
        },
        uid:{
            type: null,
            value: '',
        }

    },

    /**
     * 组件的初始数据
     */
    data: {
        identity: 0,
        errcode:-1,
        is_show:1,
    },

    lifetimes: {
        // 页面被展示
        attached() {
            var that = this;
            that.setData({
                identity: app.globalData.identity,
            })
            share.wxRequest('crmapi/User/shopInfo', {}, function (res) {
                if (Number(res.data.errcode) == 0) {
                    var is_show = res.data.data.is_show;
                    that.setData({
                        is_show: is_show,
                    })
                }
            })
        }
    },

    /**
     * 组件的方法列表
     */
    methods: {
        showMyTips(data, nowPage){
            var that = this;
            // console.log(data)
            if (Number(nowPage)<=0){
                that.setData({
                    courseListall:data,
                    errcode:1
                })
            }else{
                if (Number(data.length)>0){
                    that.setData({
                        courseListall: that.data.courseListall.concat(data),
                    })
                }else{
                    that.setData({
                        courseListall: that.data.courseListall,
                    })
                }
            }
            that.triggerEvent('hideloadingfalse', '1')
        },
        logpay(e){
            var that = this;
            var item = e.currentTarget.dataset.item;
            if (Number(that.data.identity)==1){
                wx.navigateTo({
                    url: '/pages/public/paylog?uc_id=' + item.id + '&audit_id=' + item.audit_id +'',
                })
            }
        },
        // 点击选课
        chooseclick() {
            var that = this;
            that.triggerEvent('choosecourseall', '1')
        },
        // 点击我的
        studentmy(){
            wx.redirectTo({
                url: '/pages/student/mine',
            })
        },
    }
})